package com.baidu.www;

public class Student {

        private String name;
        private String sex;
        private int  age;
        private static String classRoom;
        //实例代码块
        {
            this.sex = "girl";
            System.out.println("我是实例代码块");
        }
        // 静态代码块
        static {
            classRoom = "111";
            System.out.println("我是静态代码块");
        }

    public Student(String name,  int age) {
        this.name = name;
        this.age = age;
        System.out.println("我是构造方法");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
